import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * Created by yijy on 2017/6/20.
 */
public class testDate {
    private static int Days=30;

    public static void main(String[] args) throws Exception {
        boolean f = compareToEndDate("2017-08-02",new Date());
        if(!f){
            System.out.println(f);
        }else{
            System.out.println(f+"111111111");
        }

    }

    public static boolean compareToEndDate(String nowdate,Date end_date) throws Exception {
        GregorianCalendar gc=new GregorianCalendar();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        gc.setTime(end_date);
        gc.add(GregorianCalendar.DATE, Days);
        Calendar c1 = Calendar.getInstance();
        Calendar c2 = Calendar.getInstance();
        c1.setTime(sdf.parse(nowdate) );
        c2.setTime(gc.getTime());
        int result = c1.compareTo(c2);
        if(result>0){//该期的逾期天数大于30天
            return true;
        }
        return false;
    }
}
